﻿/**********************************************************************
* @file   FITKGlobalFrequencyDomainAdaptor.h
* @brief  全局频率读写适配器
* @author yangjing (1195810980@qq.com)
* @date   2025-02-25
*********************************************************************/
#ifndef _FITFK_GLOBAL_FREQUENCY_DOMAIN_ADAPTOR_H___
#define _FITFK_GLOBAL_FREQUENCY_DOMAIN_ADAPTOR_H___

#include "FITKAcousticsAbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbstractLoad.h"
#include <H5Cpp.h>
namespace IO {
    class FITKHDF5FileTool;
}

namespace Acoustics {
    class FITKGlobalFrequencyDomain;

}

namespace IO
{
    class FITKAcousticsHDF5IOAPI FITKGlobalFrequencyDomainAdaptor : public FITKAcousticsAbsAdaptor
    {
    public:
        explicit FITKGlobalFrequencyDomainAdaptor() = default;
        virtual ~FITKGlobalFrequencyDomainAdaptor() = default;

        virtual bool adaptR() override;

        virtual bool adaptW() override;

    private:
        bool writeGlobalFrequencyDomain(H5::Group&gp, Acoustics::FITKGlobalFrequencyDomain* data);
        bool readGlobalFrequencyDomain(H5::Group&gp, Acoustics::FITKGlobalFrequencyDomain* data);

    private:
        IO::FITKHDF5FileTool*m_toolp{ nullptr };
    };
    Register2FITKIOAdaptorFactory(FITKAcousticsHDF5, Acoustics::FITKGlobalFrequencyDomain, FITKGlobalFrequencyDomainAdaptor);
}
#endif
